package com.cc.entity;

import lombok.Data;

import java.util.List;

/**
 * @author CC
 * @version 1.0
 * @description: TODO
 * @date 2025/4/18 8:52
 */
@Data
public class Page <T>{
    //当前页码
    private int pageNum =1;
    //每页显示条数
    private int pageSize = 5;
    //总条数
    private int total;
    //总页数
    private int totalPage;
    //数据
    private List<T> data;

    public void setTotal(int total) {
        if(total>0){
            this.totalPage = (total%pageSize==0)?(total/pageSize):(total/pageSize+1);
        }
        this.total = total;
    }
}
